return xce->ops->u.evtchn.notify(xce, xce->ops_handle, port);
}
+evtchn_port_or_error_t
+xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
+{
+ return xce->ops->u.evtchn.bind_unbound_port(xce, xce->ops_handle, domid);
+}
+
/*
* Local variables:
* mode: C
return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
+static evtchn_port_or_error_t
+linux_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_unbound_port bind;
bind.remote_domain = domid;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
}
evtchn_port_or_error_t
.u.evtchn = {
.fd = &linux_evtchn_fd,
.notify = &linux_evtchn_notify,
+ .bind_unbound_port = &linux_evtchn_bind_unbound_port,
},
};
wake_up(&event_queue);
}
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
+static evtchn_port_or_error_t minios_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
{
+ int fd = (int)h;
int ret, i;
evtchn_port_t port;
assert(get_current() == main_thread);
- i = port_alloc(xce->fd);
+ i = port_alloc(fd);
if (i == -1)
return -1;
printf("xc_evtchn_bind_unbound_port(%d)", domid);
- ret = evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)xce->fd, &port);
+ ret = evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)fd, &port);
printf(" = %d\n", ret);
if (ret < 0) {
errno = -ret;
return -1;
}
- files[xce->fd].evtchn.ports[i].bound = 1;
- files[xce->fd].evtchn.ports[i].port = port;
+ files[fd].evtchn.ports[i].bound = 1;
+ files[fd].evtchn.ports[i].port = port;
unmask_evtchn(port);
return port;
}
.u.evtchn = {
.fd = &minios_evtchn_fd,
.notify = &minios_evtchn_notify,
+ .bind_unbound_port = &minios_evtchn_bind_unbound_port,
},
};
return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn * xce, int domid)
+static evtchn_port_or_error_t
+netbsd_evtchn_bind_unbound_port(xc_evtchn * xce, xc_osdep_handle h, int domid)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_unbound_port bind;
int ret;
bind.remote_domain = domid;
- ret = ioctl(xce->fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+ ret = ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
if (ret == 0)
return bind.port;
else
.u.evtchn = {
.fd = &netbsd_evtchn_fd,
.notify = &netbsd_evtchn_notify,
+ .bind_unbound_port = &netbsd_evtchn_bind_unbound_port,
},
};
return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
+static evtchn_port_or_error_t
+solaris_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_unbound_port bind;
bind.remote_domain = domid;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
}
evtchn_port_or_error_t
.u.evtchn = {
.fd = &solaris_evtchn_fd,
.notify = &solaris_evtchn_notify,
+ .bind_unbound_port = &solaris_evtchn_bind_unbound_port,
},
};
int (*fd)(xc_evtchn *xce, xc_osdep_handle h);
int (*notify)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
+
+ evtchn_port_or_error_t (*bind_unbound_port)(xc_evtchn *xce, xc_osdep_handle h, int domid);
} evtchn;
} u;
};